<?php
class HelpAction extends Action{
	public function index(){
		$Zhinan=M('Page_zhinan');
		$Tk=M('Page_tk');
		$Pay=M('Page_payment');
		$Ship=M('Page_ship');
		$Com=M('Page_company');

		$this->zhinan=$Zhinan->select();
		$this->tk=$Tk->select();
		$this->pay=$Pay->select();
		$this->ship=$Ship->select();
		$this->com=$Com->where("type !='bottom'")->select();

		$this->user=$_SESSION['euname'];
		$this->cat=R('Goods/goods_cat');
		$shop_cart=cookie('shopcart');
		$this->cart_num=!empty($shop_cart)?count(unserialize(stripslashes($shop_cart))):0;
		$this->name=C('WEB_NAME');
		$this->display();
	}

	public function page(){
		$Zhinan=M('Page_zhinan');
		$Tk=M('Page_tk');
		$Pay=M('Page_payment');
		$Ship=M('Page_ship');
		$Com=M('Page_company');

		$type=$this->_get('type');
		$map['id']=$this->_get('id');
		$map2['type']=$this->_get('c');

		switch($type){
			case 'zhinan':
				$this->page=$Zhinan->where($map)->find();
			    break;
			case 'tk':
				$this->page=$Tk->where($map)->find();
			    break;
			case 'pay':
				$this->page=$Pay->where($map)->find();
			    break;
			case 'ship':
				$this->page=$Ship->where($map)->find();
			    break;
			case 'com':
				$this->page=$Com->where($map2)->find();
			    break;
		}

		$this->zhinan=$Zhinan->select();
		$this->tk=$Tk->select();
		$this->pay=$Pay->select();
		$this->ship=$Ship->select();
		$this->com=$Com->where("type !='bottom'")->select();

		$this->user=$_SESSION['euname'];
		$this->cat=R('Goods/goods_cat');
		$shop_cart=cookie('shopcart');
		$this->cart_num=!empty($shop_cart)?count(unserialize(stripslashes($shop_cart))):0;
		$this->name=C('WEB_NAME');
		$this->display();
	}


}
?>